// models/ArticleTag.ts
import { DataTypes, Model } from "sequelize";
import sequelize from "../config/db";

export class ArticleTag extends Model {}

ArticleTag.init(
  {
    id: {
      type: DataTypes.INTEGER,
      primaryKey: true,
      autoIncrement: true,
    },
    article_id: {
      type: DataTypes.INTEGER,
      allowNull: false,
    },
    tag_id: {
      type: DataTypes.INTEGER,
      allowNull: false,
    },
  },
  {
    sequelize,
    tableName: "article_tags",
    timestamps: false,
  }
);

export default ArticleTag;
